<%@page import="miniprojet.jeux.modele.Arbitre"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Foundation -->
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/normalize.css" />
<script src="js/vendor/custom.modernizr.js"></script>
<% 
	String nomArbitre = "";
	String prenomArbitre = "";
	String titrePage = "Ajout nouvel arbitre";
	String action = "administration?action=saveArbitre";
	String nomBouttonSubmit = "Créer";
	miniprojet.jeux.modele.Arbitre arbitre = (miniprojet.jeux.modele.Arbitre) session.getAttribute("editionArbitre");
	if (arbitre != null) {
		nomArbitre = arbitre.getNom();
		prenomArbitre = arbitre.getPrenom();
		titrePage = "Edition arbitre";
		action += "&id=" + arbitre.getIdPersonne();
		nomBouttonSubmit = "Modifier";
	}
%>
<title><%= titrePage %></title>
</head>
<body class="antialiased">
	<jsp:include page="/administration/inc_testLogin.jsp"></jsp:include>
	<jsp:include page="/inc_menu.jsp"></jsp:include>
	<form method="post" action="<%= action %>">
		<fieldset style="width: 60%; margin-left:auto; margin-right: auto; margin-top: 100px;">
			<legend>Arbitre</legend>
			<label>Nom :</label>
			<input type="text" id="tbNomArbitre" name="tbNomArbitre" value="<%= nomArbitre %>"> 
			<label>Prénom :</label> 
			<input type="text" id="tbPrenomArbitre" name="tbPrenomArbitre" value="<%= prenomArbitre %>">
			<%
				if (request.getParameter("error") != null) { %>
					<label style="color: red;"><%= request.getParameter("error") %></label>
			<% 	
				}
				else if (request.getParameter("success") != null) { %>
					<label style="color: green;"><%= request.getParameter("success") %></label>
			<%
				}
			%>
			<div style="margin-left:auto; margin-right:auto; width: 250px;" >
				<a href="administration?action=listeArbitres" class="button small">Retour</a>
				<input type="submit" class="button small" value="<%= nomBouttonSubmit %>"/>
			</div>
		</fieldset>
	</form>
	<script>
		document.write('<script src='
				+ ('__proto__' in {} ? 'js/vendor/zepto'
						: 'js/vendor/jquery') + '.js><\/script>');
	</script>
	<script src="js/foundation.min.js"></script>
	<script src="js/foundation/foundation.section.js"></script>
	<script>
		$(document).foundation();
	</script>
</body>
</html>